package com.pureut.storage.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.pureut.storage.domain.PurchaseReceipt;
import com.pureut.storage.dto.*;
import com.pureut.storage.export.PurchaseReceiptExport;
import com.pureut.storage.vo.*;
import com.sale.common.mybatis.core.page.PageQuery;
import com.sale.common.mybatis.core.page.TableDataInfo;
import com.sale.order.api.vo.PurchaseOrderTraceVo;
import com.sale.storage.api.dto.PurchaseOrderTrackDto;
import com.sale.storage.api.vo.UpdateInvoicedQuantityVo;

import java.util.List;

/***
 * 采购入库service
 * Author:C
 * Date:2022/12/23 10:14
 * @DESC
 */
public interface PurchaseReceiptService {

    /**
     * 获取列表
     */
    TableDataInfo<PurchaseReceiptDto> getReceiptList(PurchaseReceiptVo purchaseReceiptVo, PageQuery pageQuery) throws Exception;

    /**
     * 新增
     */
    boolean addReceipt(PurchaseReceiptVo purchaseReceiptVo) throws Exception;

    /**
     * 批次到货新增
     */
    boolean batchArrival(PurchaseOrderDto purchaseOrderDto) throws Exception;

    /**
     * 关结
     */
    boolean close(PurchaseReceiptVo purchaseReceiptVo);

    /**
     * 查看
     */
    PurchaseReceiptDto getView(Long id);

    /**
     * 修改
     */
    boolean updateReceipt(PurchaseReceiptVo purchaseReceiptVo);

    /**
     * 删除
     */
    boolean deleteReceipt(String idStr);

    /**
     * 入库/送检
     */
//    boolean warehousInspection(WarehousInspectionVo warehousInspectionVo) throws Exception;

    /**
     * 导出
     */
    List<PurchaseReceiptExport> getInfoExport(PurchaseReceiptVo purchaseReceiptVo);

    /**
     * 采购入库（pda）
     */
    PickingRestDbDto warehousingPda(PickingRestDbVo pickingRestDbVo);

    /**
     * 入库打印
     */
    boolean storagePrinting(StoragePrintingVo storagePrintingVo) throws Exception;

    /**
     * 根据采购订单状态修改采购入库状态(feign调用)
     */
    boolean updateReceiptStatus(UpdateReceiptStatusVo updateReceiptStatusVo);

    /**
     * 采购入库交接
     */
    PickingRestHandoverDto handover(PickingRestDbVo pickingRestDbVo);

    /**
     * 采购入库拣货完成
     */
    boolean pickingCompleted(PickingRestDbVo pickingRestDbVo);

    /**
     * 安卓pda 列表
     */
    TableDataInfo<AndroidPdaDto> androidPdaList(int number,PageQuery pageQuery);

    /**
     * 手持pda 查看接口
     */
    AndroidPdaViewDto androidPdaView(int number, long id);

    /**
     * 手持pda 拣货撤销列表
     */
    TableDataInfo<AndroidPdaDto> pickCancellationList(PageQuery pageQuery,int number);

    /**
     * 手持pda 拣货完成
     */
    boolean completionPickingAndroid(CompletionPickingVo completionPickingVo) throws Exception;

    /**
     * 手持pda 拣货撤销
     */
    boolean pickCancellationAndroid(CompletionPickingVo completionPickingVo);

    /**
     * 手持pda 交接列表
     */
    TableDataInfo<AndroidHandoverPdaDto> androidHandoverList(int number,PageQuery pageQuery);

    /**
     * 手持pda 交接详情
     */
    AndroidHandoverPdaDto androidHandoverView(int number, Long id);

    /**
     * 手持pda 交接
     */
    PickingRestHandoverDto androidHandover(AndroidHandoverVo androidHandoverVo);

    /**
     * 财务模块修改采购入库发票数量及核销金额
     * @param updateInvoicedQuantityVo
     * @return
     */
    boolean updateInvoicedQuantity(UpdateInvoicedQuantityVo updateInvoicedQuantityVo);

    /**
     * 根据供应商编码获取该供应商总欠款
     */
    String getBalance(String supplierCode);

    /**
     * 财务-核销单（根据供应商编码获取对应数据）
     */
    TableDataInfo<ImparityDto> getDataByCode(GetDataByCodeVo getDataByCodeVo, PageQuery pageQuery);

    /**
     * 采购订单跟踪查询
     * @return PurchaseOrderTrackDto
     */
    TableDataInfo<PurchaseOrderTrackDto> purchaseOrderTrackList(PurchaseOrderTraceVo purchaseOrderTraceVo);

    /**
     * 采购统计 - 采购汇总表物料统计
     * @param materialStatListVo
     * @return
     */
    TableDataInfo<MaterialStatListDto> materialStatList(MaterialStatListVo materialStatListVo, PageQuery pageQuery) throws Exception;

    /**
     * 财务-核销单 通过获取未全部核销的采购入库单、采购退货单、其他支出单数据
     */
    TableDataInfo<ImparityDto> getNoVerificationList(GetDataByCodeVo getDataByCodeVo, PageQuery pageQuery);

    /**
     * 查询仓库单据数据（结账反结账使用）
     */
    ClosingDocumentDto closingCounterClosingDocument(String time);

    /**
     * 入库打印
     */
    boolean warehousInspection(WarehousInspectionVo warehousInspectionVo) throws Exception;
}
